package xin.ganbo.exception;

/**
 * 自定义系统业务异常
 * @author ganbo E-mail:bo.gan@56qq.com
 * @since 2017-09-29 14:03
 */

public class BusinessException extends RuntimeException {

    /** 错误码 */
    private String errorCode;
    /** 错误描述 */
    private String errorMsg;

    /**
     * 创建异常
     * @param errorCode
     * @param errorMsg
     */
    public BusinessException(String errorCode, String errorMsg) {
        super(String.format("BusinessException{errorCode:%s, errorMsg:%s}", errorCode, errorMsg));
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
